<?php

namespace App\Models\Order;

use Hyn\Tenancy\Traits\UsesTenantConnection;
use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Order\PaymentMethod
 *
 * @property int $id
 * @property string $name
 * @property string|null $label
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Order\Order[] $orders
 * @property-read int|null $orders_count
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Order\PaymentMethod newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Order\PaymentMethod newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Order\PaymentMethod query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Order\PaymentMethod whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Order\PaymentMethod whereLabel($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Order\PaymentMethod whereName($value)
 * @mixin \Eloquent
 */
class PaymentMethod extends Model
{
    use UsesTenantConnection;
    protected $guarded = [];
    public $timestamps = false;

    public function orders()
    {
        return $this->hasMany(Order::class, 'payment_method_id');
    }
}
